package com.bridge.client.bridgedynamcclient.consts;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

public enum BridgeTypeEnum {

    TYPE_1(1,"梁桥"),
    TYPE_2(2,"拱桥"),
    TYPE_3(3,"斜拉桥"),
    TYPE_4(4,"悬索桥"),
    ;

    Integer type;
    String desc;

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    private static Map<Integer,String> maps= Arrays.stream(values()).collect(Collectors.toMap(BridgeTypeEnum::getType,BridgeTypeEnum::getDesc));

    BridgeTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getDescByType(Integer type){
        return maps.get(type);
    }
}
